def main():
    n = int(input())
    visited = set()
    current = 1
    visited.add(current)
    for m in range(2,1001):
        current = (current + m) % n
        if current == 0:
            current = n
        visited.add(current)
    safe_holes = [hole for hole in range(1,n+1) if hole not in visited]
    safe_holes.sort()
    if not safe_holes:
        print(0)
    else:
        for hole in safe_holes:
            print(hole)

main()